import time

from selenium import webdriver


class UpdateSysStatus():
    def __init__(self, login_inst):
        self.login_inst = login_inst

    def login_cpquery(self, key_words):
        page = 2
        chrome_driver = r"D:\谷歌下载\chromedriver_win32(0)\chromedriver.exe"
        driver = webdriver.Chrome(executable_path=chrome_driver)
        driver.get("http://cpquery.cnipa.gov.cn/")
        time.sleep(5)


        # if self.login_inst == 'XH':
        #     driver.find_element_by_id("username").clear()
        #     driver.find_element_by_id("username").send_keys('CN00675769')
        #     time.sleep(2)
        #     driver.find_element_by_id("password").clear()
        #     driver.find_element_by_id("password").send_keys('Gv89NWWY@')
        # elif self.login_inst == 'XHHG':
        #     driver.find_element_by_id('username').clear()
        #     driver.find_element_by_id('username').send_keys('42264')
        #     time.sleep(1)
        #     driver.find_element_by_id('password').clear()
        #     driver.find_element_by_id('password').send_keys('Xhhg0613@@')
        # elif self.login_inst == 'WB':
        #     # 15978554102 Hhr31415926!
        #     # 17362997328 Ccy1994!
        #     # 15090891351 Ccy1994!
        #     # 13296529358 king123!B
        #     driver.find_element_by_id('username1').clear()
        #     driver.find_element_by_id('username1').send_keys('13283766953')
        #     time.sleep(1)
        #     driver.find_element_by_id('password1').clear()
        #     driver.find_element_by_id('password1').send_keys('Ws1234567890~')

    def run(self):
        key_words = "笔记本电脑"
        self.login_cpquery(key_words)
        pass


if __name__ == '__main__':
    up = UpdateSysStatus
    # 1. 协和端口账号查询状态 第一遍查询插入  账号: CN00675769  密码: Gv89NWWY@  查询: 2020207090033
    up('XH').run()
    # 2. 信合红谷端口账号查询状态 第二遍查询更新  账号: 42264  密码: Xhhg0613@@  查询: 2019214697762
    # up('XHHG').run()
    # 3 第三遍使用公众登录查询 查询: 2020207090033
    # up('WB').run()
    # 4. 本地 xhhg_patnet_status	导入线上库，已经更新了优先审查信息
    # update_system_status()

